﻿using Ken_WPF_UI.Model;
using Ken_WPF_UI.ViewModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Ken_WPF_UI.Data
{
    public class TreeData
    {

        public static Collection<ResourceDictionary> mergedDictionaries = App.Current.Resources.MergedDictionaries;


        public static List<TreeItemModel> GetTreeNodeList()
        {
            //
            List<TreeItemModel> treeNodeList = new List<TreeItemModel>();

            //一级菜单
            TreeItemModel treeNode1 = new TreeItemModel() { TreeId=100,ParentId=0,TreeName= "系统管理",IsOpen= true };
            TreeItemModel treeNode1_1 = new TreeItemModel() { TreeId=101,ParentId=100, TreeName= "角色管理" ,StyleKey= (Style)mergedDictionaries[0]["treeViewStyle"] };
            TreeItemModel treeNode1_2 = new TreeItemModel() { TreeId=102,ParentId=100, TreeName= "地区管理", StyleKey = (Style)mergedDictionaries[0]["treeViewStyle"] };
            treeNode1.SubList.Add(treeNode1_1);
            treeNode1.SubList.Add(treeNode1_2);
            treeNodeList.Add(treeNode1);


            TreeItemModel treeNode2 = new TreeItemModel() { TreeId = 201, ParentId = 0, TreeName = "商品管理" };
            TreeItemModel treeNode2_1 = new TreeItemModel() { TreeId = 101, ParentId = 100, TreeName = "单位管理", StyleKey = (Style)mergedDictionaries[0]["treeViewStyle"] };
            TreeItemModel treeNode2_2 = new TreeItemModel() { TreeId = 102, ParentId = 100, TreeName = "类别管理", StyleKey = (Style)mergedDictionaries[0]["treeViewStyle"] };
            treeNode2.SubList.Add(treeNode2_1);
            treeNode2.SubList.Add(treeNode2_2);
            treeNodeList.Add(treeNode2);


            TreeItemModel treeNode3 = new TreeItemModel() { TreeId = 301, ParentId = 0, TreeName = "任务管理" };
            TreeItemModel treeNode3_1 = new TreeItemModel() { TreeId = 101, ParentId = 100, TreeName = "出库任务", StyleKey = (Style)mergedDictionaries[0]["treeViewStyle"] };
            TreeItemModel treeNode3_2 = new TreeItemModel() { TreeId = 102, ParentId = 100, TreeName = "销售任务", StyleKey = (Style)mergedDictionaries[0]["treeViewStyle"] };
            treeNode3.SubList.Add(treeNode3_1);
            treeNode3.SubList.Add(treeNode3_2);
            treeNodeList.Add(treeNode3);

            return treeNodeList;
        }


    }
}
